package cn.edu.scau.cmi.zhuangjunsheng.Client;

import java.util.Scanner;

import cn.edu.scau.cmi.zhuangjunsheng.abstractFactory.domainAbstractClass.Meat;
import cn.edu.scau.cmi.zhuangjunsheng.abstractFactory.factory.AbstractFactory;
import cn.edu.scau.cmi.zhuangjunsheng.abstractFactory.factory.AonongFactory;
import cn.edu.scau.cmi.zhuangjunsheng.abstractFactory.factory.TianbangFactory;
import cn.edu.scau.cmi.zhuangjunsheng.abstractFactory.factory.WensFactory;



public class AbstractFactoryClient {
	public static void main(String[] args) {
		
		//(1) 选择品牌
				System.out.println("Please select which brand you want to buy: Wens, Tianbang or Aonong???");
				Scanner scanner = new Scanner(System.in);  
				String brandKind = scanner.next();  
				AbstractFactory factory=null;
				switch(brandKind){
				case "Wens": factory=new WensFactory();break;
				case "Tianbang": factory=new TianbangFactory();break;
				case "Aonong": factory=new AonongFactory();break;
				default:System.out.println("sorry, your input is not correct");
				
				}
				
//				（2）选择产品
				
				System.out.println("Please select which product you want to buy: beef, prok or chicken???");
//				Scanner scanner = new Scanner(System.in);  
				String meatType = scanner.next();  
				Meat meat=null;
				switch(meatType) {
				case "beef": meat=factory.createBeef();break;
				case "pork": meat=factory.createPork();break;
				case "chicken": meat=factory.createChicken();break;
				default:System.out.println("sorry, your input is not correct");
				
				}
				if(meat!=null) {
					meat.cook();
				}
				
				
//				
//				// （1）获取工厂
//				
//				AbstractFactory factory = AbstractFactory.getFactory("apple");
		//
//				// (2)获取对象
//				Pad product = factory.createPad();
////				（3）对象执行功能
//				product.play();

			}
}
